﻿<%@ Page Title="" Language="C#" MasterPageFile="~/provider/CarInsurance/Liberty_CarInsurance.master" AutoEventWireup="true" 
CodeFile="subpage_access.aspx.cs" Inherits="provider_UserAccess_subpage_access" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="provider_inner">
        <h1>Main Pages User Access</h1>
        <fieldset>
            <dl>
                <dt class="top_action">
                    <label>Main Page : </label></dt>
                <dd>
                    <asp:DropDownList ID="ddlMainPage" runat="server" AutoPostBack="true" onselectedindexchanged="ddlMainPage_SelectedIndexChanged"></asp:DropDownList>
                    <label>User : </label>
                    <asp:DropDownList ID="ddlUser" runat="server" AutoPostBack="true" onselectedindexchanged="ddlUser_SelectedIndexChanged"></asp:DropDownList>
                </dd>
                
            </dl>
        </fieldset>
 
        <asp:GridView ID="grvUserAccess" runat="server" AllowPaging="False" AllowSorting="True"
            AutoGenerateColumns="False" CellPadding="2" CssClass="progridstyle" EmptyDataText="There are no data records to display."
            GridLines="None" DataKeyNames="MainPageId" DataSourceID="sqlDsSubPages" 
            onrowdatabound="grvUserAccess_RowDataBound" >
            <FooterStyle />
            <PagerStyle />
            <Columns>
                <asp:TemplateField HeaderText="MainPageId" Visible="false">
                    <ItemTemplate>
                            <asp:Label ID="lblMainPageId" runat="server" Text='<%# Eval("MainPageId").ToString()%>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="SubPageId" Visible="false">
                    <ItemTemplate>
                            <asp:Label ID="lblSubPageId" runat="server" Text='<%# Eval("SubPageId").ToString()%>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="ProviderCompanyId" Visible="false">
                    <ItemTemplate>
                            <asp:Label ID="lblProviderCompanyId" runat="server" Text='<%# Eval("ProviderCompanyId").ToString()%>'></asp:Label> 
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ProviderSubPageName" HeaderText="Page Name" />
                <asp:BoundField DataField="CXSubPageName" HeaderText="Page Name" Visible="false" />
                <asp:TemplateField HeaderText="User Access">
                    <ItemTemplate>
                             <asp:DropDownList ID="ddlUserAccess" runat="server">
                                <asp:ListItem Value="0">Not Accessible</asp:ListItem>
                                <asp:ListItem Value="100">View</asp:ListItem>
                                <asp:ListItem Value="200">View/Update</asp:ListItem>
                                <asp:ListItem Value="300">View/Update/Delete</asp:ListItem>
                             </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField> 
            </Columns>
            <SelectedRowStyle CssClass="progridover" />
            <HeaderStyle CssClass="progridheader" />
            <EditRowStyle />
            <AlternatingRowStyle CssClass="progridodd" />
            <RowStyle CssClass="progrideven" />
        </asp:GridView>
        <asp:SqlDataSource ID="sqlDsSubPages" runat="server" ConnectionString="<%$ ConnectionStrings:CX_DBConnectionString %>"
            SelectCommand="sprocProviderSubPagesSelectItemList" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="ProviderCompanyId" SessionField="ProviderCompanyId" Type="Int64" />
                <asp:ControlParameter ControlID="ddlMainPage" Name="MainPageId" PropertyName="SelectedValue" Type="Int64" />
            </SelectParameters>
        </asp:SqlDataSource>
        <fieldset class="action">
            <asp:ImageButton OnClientClick="javascript:return confirm('Are you sure to go back?');"
                ID="ImageButton1" runat="server" CssClass="left_btn" ImageUrl="~/Provider/images/buttons/back1.gif"
                OnClick="ibtBack_Click" />
            <asp:ImageButton ID="btnSave" runat="server" CssClass="float_btn" ImageUrl="~/Provider/images/buttons/save1.gif"
                OnClick="btnSave_Click" />
        </fieldset>
<%--        <asp:ImageButton OnClientClick="javascript:return confirm('Are you sure to go back?');"
            ID="ibtBack" runat="server" ImageUrl="~/Provider/images/buttons/back1.gif" 
            onclick="ibtBack_Click"  /><input id="inputrefid" runat="server" type="hidden"  />--%>
    </div>
</asp:Content>

